package com.huika.dealontop.control.homepage.utils.fourad.fouradfactory;

import android.app.Activity;
import android.view.View;

import com.huika.dealontop.control.homepage.utils.fourad.FourAd;
import com.huika.dealontop.control.homepage.utils.fourad.OneAd;
import com.huika.dealontop.control.homepage.utils.fourad.ThreeAd;
import com.huika.dealontop.control.homepage.utils.fourad.TwoAd;
import com.huika.dealontop.support.domain.HomePageAdvertisementSeatInfo;

import java.util.ArrayList;

/**
 * Created by cailu on 2016/1/13.
 */
public class FourAdFactory {
    private Activity mContext;
    private ArrayList<HomePageAdvertisementSeatInfo> mInfo;


    public FourAdFactory(Activity context,ArrayList<HomePageAdvertisementSeatInfo> info){

        mContext = context;
        mInfo = info;



    }

    public View selectAdView(){
        View view = null;

        switch(mInfo.size()){
            case 1:
                view =  new OneAd(mContext,mInfo).getAdView();
                break;
            case 2:
                view =  new TwoAd(mContext,mInfo).getAdView();
                break;
            case 3:
                view =  new ThreeAd(mContext,mInfo).getAdView();
                break;
            case 4:
               view =  new FourAd(mContext,mInfo).getAdView();
                break;
            default :
                break;
        }
        return view;
    }
}
